package com.flower.hooc.app.api.controller;

import com.flower.hooc.bean.pojo.entity.Video;
import com.flower.hooc.bean.pojo.vo.RespResult;
import com.flower.hooc.service.VideoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@CrossOrigin
@RestController
@RequestMapping("/hooc/video")
@Api(tags = "课程视频接口")
public class VideoController extends BaseController {

    private Logger logger = LoggerFactory.getLogger(UserController.class);

    @Autowired
    private VideoService videoService;

    @RequestMapping(value = "/getVideo")
    @ApiOperation("查询视频详情")
    public RespResult getVideoById(Long videoId) {
        logger.info("into getVideo videoId:{}", videoId);
        Video video = videoService.selectVideoById(videoId);
        return returnRespWithSuccess(video);
    }

}
